﻿dynamic class Say{
	public static var M_SAY:String="M_say";
	private var $showName:Boolean;
	private var $name:String;
	
	
	public function get ShowName():Boolean{
		return this.$showName;
	}
	public function set ShowName(value:Boolean){
		this.$showName=value;
	}
	
	public function get Name():String{
		return this.$name;
	}
	public function set Name(value:String){
		this.$name=value;
	}
	
	
	
	
	
	public function Say(name:String){
		this.$showName=true;
		this.$name=((name==undefined)? "":name);
		AsBroadcaster.initialize(this);
	}
	
	private function _say(o:Object){
		if(this.$showName){
			this.broadcastMessage(Say.M_SAY,this.$name+": "+o);
		}else{
			this.broadcastMessage(Say.M_SAY,o);
		}
		//trace(this.$name+": "+o.toString());
	}
	public function esay(o:Object){
		_say("**error** "+o.toString());
	}
	public function wsay(o:Object){
		_say("**warnning** "+o.toString());
	}
	public function msay(o:Object){
		_say(o);
	}
}